﻿SELECT 
	TRIM(TRAC_ID) TRAC_ID, 
	PORTFOLIO, 
	PROPERTY_NM, 
	MARKET, 
	REGION, 
	PROGRAM, 
	CASE NATIONAL_IND WHEN 'Y' THEN 'YES' ELSE 'NO' END NATIONAL_IND, 
	AREA_MGR, 
	ACCT_MGR, 
	SUBSTR(TRAC_ID,1,2) STATE, 
	CAST(SUBSTR(TRAC_ID,3) AS INTEGER) TRAC_NUM 
	FROM SUNRISE_TEST.ACC_BASE_DATA 
WHERE HAS_ADDRS='Y' ;